package com.youpai.platform.chat.web.api;

import com.youpai.platform.chat.service.entity.dto.ChatSessionDTO;
import com.youpai.platform.chat.service.service.ChatSessionService;
import com.youpai.platform.chat.web.entity.req.CreateSessionReq;
import com.youpai.platform.chat.web.entity.req.SyncSessionListRequest;
import com.youpai.platform.chat.web.entity.resp.CreateSessionResp;
import com.youpai.platform.chat.web.entity.resp.SyncSessionListResp;
import com.youpai.platform.common.entity.resp.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
 * @Description: 会话相关
 * @Author:welles
 * @Date:2022/7/23
 */
@Slf4j
@RestController
@RequestMapping(value = "/chat/session")
@Api(value = "ChatSessionController", tags = "会话相关")
public class ChatSessionController {

    @Resource
    private ChatSessionService chatSessionService;

    @ApiOperation(value = "查询用户会话列表")
    @PostMapping(value = "/list/query")
    public BaseResponse<List<ChatSessionDTO>> syncSessionListRequest(@RequestBody SyncSessionListRequest req) {
        return BaseResponse.success(chatSessionService.syncSessionListRequest(req));
    }
}
